home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / tcl / TildeSubst.man < prev   
Encoding:
Text File  |  1992-11-08  |  2.5 KB  |  67 lines

  1.  
  2.  
  3.  
  4. Tcl_TildeSubst        C Library Procedures         Tcl_TildeSubst
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      Tcl_TildeSubst - replace tilde with home directory in a file
  12.      name
  13.  
  14. SSYYNNOOPPSSIISS
  15.      ##iinncclluuddee <<ttccll..hh>>
  16.  
  17.      char *
  18.      TTccll__TTiillddeeSSuubbsstt(_i_n_t_e_r_p, _n_a_m_e)
  19.  
  20. AARRGGUUMMEENNTTSS
  21.      Tcl_Interp   *_i_n_t_e_r_p   (in)      Interpreter  in  which   to
  22.                                       report an error, if any.
  23.  
  24.      char         *_n_a_m_e     (in)      File name, which may  start
  25.                                       with a ``~''.
  26. _________________________________________________________________
  27.  
  28.  
  29. DDEESSCCRRIIPPTTIIOONN
  30.      This utility  procedure  does  tilde  substition.   If  _n_a_m_e
  31.      doesn't  start  with  a  ``~'' character, then the procedure
  32.      returns _n_a_m_e.   If  _n_a_m_e  does  start  with  a  tilde,  then
  33.      TTccll__TTiillddeeSSuubbsstt returns a new string identical to _n_a_m_e except
  34.      that the first element of _n_a_m_e is replaced with the location
  35.      of  the home directory for the given user.  The substitution
  36.      is carried out in the same way that it would be done by _c_s_h.
  37.      If  the  tilde  is followed immediately by a slash, then the
  38.      $$HHOOMMEE environment variable is  substituted.   Otherwise  the
  39.      characters between the tilde and the next slash are taken as
  40.      a user name, which is looked up in the password  file;   the
  41.      user's  home  directory  is retrieved from the password file
  42.      and substituted.
  43.  
  44.      The string returned by TTccll__TTiillddeeSSuubbsstt  is  a  static  string
  45.      belonging  to  TTccll__TTiillddeeSSuubbsstt.   Its value will only persist
  46.      until the next call to TTccll__TTiillddeeSSuubbsstt;   the  caller  should
  47.      make a copy of the result if it needs to live a long time.
  48.  
  49.      If an error occurs (e.g. because there was no  user  by  the
  50.      given  name) then NULL is returned and an error message will
  51.      be left at  _i_n_t_e_r_p->_r_e_s_u_l_t.   It  is  assumed  that  _i_n_t_e_r_p-
  52.      >_r_e_s_u_l_t  has  been  initialized  in  the  standard  way when
  53.      TTccll__TTiillddeeSSuubbsstt is invoked.
  54.  
  55.  
  56. KKEEYYWWOORRDDSS
  57.      file name, home directory, tilde, user
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0                                                     1
  64.  
  65.  
  66.  
  67.